
extends public_menu
block person_menu_content
    if(login_user && login_user.id === user.id)
        p(style="text-align:right;")
            a(href="/user/private/#{user.nick}/recipe/publish").btn.btn-default 发布菜谱
    if(!page.data || page.data.length==0)
        div.text-center 你还没有发布任何菜谱哦~
    else
        mixin item(recipe)
            div.wrapper
                a(href="/recipe/details/#{recipe.id}", alt="#{recipe.title}" target="_blank")
                    img(src="#{recipe.finishedProductImage}", alt="recipe.title")
                p.title #{recipe.title}
                div.bottom-panel
                    span.left #{dateformat(recipe.createOn)}
                    div.inline.right
                        span.glyphicon.glyphicon-heart
                        |  #{recipe.upvote}
                        span.glyphicon.glyphicon-comment
                        |  #{recipe.comment}
        mixin panel(index)
            if(index < page.data.length)
                if(index % 4 === 0)
                    div.item-panel
                        + item(page.data[index])
                    + panel(index + 4)
                else
                    div.item-panel(style="margin-left:8px")
                        + item(page.data[index])
                    + panel(index + 4)

        - var quality = page.data.length > 4 ? 4 : page.data.length
        - for(var i=0; i<quality; i++){
            div(style='display:block;float:left;width:274px')
                + panel(i)
        - }
    div.clearfix
    include ../public/page_nav
